
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-03
**/
@Entity
@Data
@Table(name="app_work_gps")
public class AppWorkGps implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "GPS ID")
    private Integer id;

    @Column(name = "work_id")
    @ApiModelProperty(value = "任务ID")
    private Integer workId;

    @Column(name = "time")
    @ApiModelProperty(value = "时间戳")
    private Long time;

    @Column(name = "lon")
    @ApiModelProperty(value = "经度")
    private Double lon;

    @Column(name = "lat")
    @ApiModelProperty(value = "纬度")
    private Double lat;

    @Column(name = "work_time")
    @ApiModelProperty(value = "已行驶时长（秒）")
    private Integer workTime;

    @Column(name = "work_mile")
    @ApiModelProperty(value = "已行驶里程（米）")
    private Float workMile;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "update_time")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新日期")
    private Timestamp updateTime;

    public void copy(AppWorkGps source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}